﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Betop.Lib.Enums;


namespace Betop.Lib.Core.Right
{
    public class SystemRight
    {
        private const int PARA = 101;
        public SystemRight() { }

        public SystemRight(SystemRightType type, SystemRightName name)
        {
            Type = type;
            Name = name;
        }

        public SystemRightName Name
        {
            get;
            set;
        }
        public SystemRightType Type
        {
            get;
            set;
        }
        public int ID
        {
            get
            {
                int rightID = (int)Type * PARA + (int)Name;
                return rightID;
            }
            set
            {
                Type = (SystemRightType)(value / PARA);
                Name = (SystemRightName)(value % PARA);
            }
        }
    }
}
